--该文件用来封装所有的点击操作


--根据排数和篮筐的位置进行点击
function throwBasketBall (color , area, x, y)

	local times = 1;
	if color == GreenColor and area == Bottom then
		times = 3;
	else 
		times = 1;
	end
	

	if  area == Middle then
		throwToMiddleArea(x,y, times);
	elseif area == Bottom then
		throwToBottomArea(x,y, times);
	end

end


--中间篮筐投球
function throwToMiddleArea (x, y, times)

		local deltaX = 60;
		local deltaY = -30;

		
		if throwCount == 0 then
			deltaY = deltaY + 80;
		end
		
		for tmpi=1,times do
      tap(x + deltaX * tmpi, y + deltaY);
    end

end

--底部篮筐投球
function throwToBottomArea (x, y, times)
		local deltaX = -60;
		local deltaY = -170;
		
		if throwCount == 0 then
			deltaY = deltaY + 200;
			deltaX = -100;
		end
		
		for tmpi=1,times do
      tap(x + deltaX * tmpi, y + deltaY);
    end

end


function throwFirstBall ()
		mSleep(100);
		
		for tmpi=1,3 do
			tap(460, 1760);
    end

end


